import React, { Component } from 'react';
import {GlobalStyle} from './style';
import Header from './common/header';
import store from './store';
import { Provider } from 'react-redux';
import {BrowserRouter, Route} from 'react-router-dom';
import Detail from './pages/detail/loadable';
import Home from "./pages/home";
import Login from "./pages/login";
import Write from './pages/write';


class APP extends Component {

    render() {
        return (
            <div>
                <GlobalStyle />
                <Provider store={store}>
                    <BrowserRouter>
                        <Header />
                        <Route  path="/" exact component={ Home } />
                        <Route  path="/login" exact component={ Login } />
                        <Route  path="/write" exact component={ Write } />
                        <Route  path="/detail/:id" exact component={ Detail } />
                    </BrowserRouter>
                </Provider>
            </div>
        );
    }
}

export default APP;